using System;
using System.Windows.Forms;
namespace Circus.CodeEditor
{
	public sealed class ErrorHandler
	{
		private static ErrorBehavior errorBehavior = ErrorBehavior.Message;
		public static ErrorBehavior ErrorBehavior
		{
			get
			{
				return ErrorHandler.errorBehavior;
			}
			set
			{
				ErrorHandler.errorBehavior = value;
			}
		}
		private ErrorHandler()
		{
		}
		public static void Error(Exception exception)
		{
			if (exception != null)
			{
				switch (ErrorHandler.errorBehavior)
				{
				case ErrorBehavior.Message:
					MessageBox.Show(exception.Message, StringConsts.ErrorCaption, MessageBoxButtons.OK, MessageBoxIcon.Hand);
					break;
				case ErrorBehavior.Exception:
					throw exception;
				}
			}
		}
	}
}
